FIG. 1 is a block diagram showing the conventional hardware configuration of a PC programming unit. In FIG. 1, a microprocessor 21 is connected by a bus 20 to a main storage device 22 comprising RAM, ROM, etc., an auxiliary storage device 23 such as a hard disk or a floppy disk, a keyboard 24, acting as an input means, a display device 25, and a printer 26.
FIG. 2 is a block diagram illustrating the flow of processing and data during the writing of a ladder diagram in a conventional programing unit. Referring to FIG. 2, the keyboard 24 is used to input data, which is temporarily stored in a keyed-in data buffer 12. The buffer 12 is connected to a ladder symbol data extraction processor 13 for extracting a ladder symbol part from the input data in the keyed-in data buffer 12, and to a device name extraction processor 14 for fetching a device name from the input data in the keyed-in data buffer 12. An instruction code conversion processor 15 communicates with the ladder symbol data extraction processor 13 and converts the ladder symbol data into a PC instruction. Similarly, a device code conversion processor 16 communicates with the device name extraction processor 14 and converts device name data into an internal code. Both of the code conversion units 15 and 16 provide outputs to screen image table creation processor 17, which generates data for displaying the ladder diagram on the display device 25 in accordance with the data obtained in the code conversion process conducted by the units 15 and 16. A block position control processor 18 is operative to indicate the position on the display device 25 where the ladder diagram image is to be created, and is responsive to inputs of line and column data from code conversion unit 15. Information from screen image table creation processor 17 is used to update the information stored in processor 18. A screen display data converter 19 will convert screen image table data from processor 17 for display on the display device 25 and will control display of that data at specified locations on the screen of display device 25.
FIG. 3 illustrates a display screen 70 having a ladder area 71, along with ladder symbol and keyed-in data display area 72. For each of screens 70A-70F, there is illustrated the sequence of key strokes used and display screens created during the writing of a ladder diagram in the conventional programming unit. This figure, together with the other aforementioned drawings may be used to explain the operation of the conventional unit in creating a PC program using the ladder diagram technique.
Referring to FIG. 1, the microprocessor 21 runs a control program stored in the main storage device 22. The control program is designed to permit the programming unit to enter a PC program creation mode when a new program is to be written using the ladder technique. Once in the PC program creation mode, the operator can enter a sequence of commands, by pressing designated keys on the keyboard to enter ladder symbols and specify the identity of PC devices. Specifically, with reference to FIG. 3, with the cursor 73 at a desired display location (here, at the start of a screen), a key on the keyboard 24 corresponding to a ladder symbol 101 is pressed, which will result in a display of the ladder symbol in the keyed-in data display area 72, as seen in the screen 70A, and then keys (here, X, O) for specifying a PC device are pressed and the keyed data is displayed in keyed-in data display area 72, as seen on screen 70B, and simultaneously the keyed-in data is stored into the keyed-in data buffer 12. By pressing a return key 104 on the keyboard 24, the data in the keyed-in data buffer 12 is output to the symbol part extraction processor 13 and the device name extraction processor 14. The symbol data is converted into an instruction code by the instruction code conversion processor 15 according to preceding and succeeding states of the ladder diagram. The device name data is checked for proper PC specifications and input format by the device code conversion processor 16, and then converted into an internal processing code. The first ladder element and device name are then displayed as seen in screen 70C, with the aid of elements 17-19. The keyed in display data area 72 is cleared at this time. The next ladder element is similarly displayed in area 72 by pressing key 105, as illustrated in screen 70D, and the next device is displayed by pressing the appropriate keys, as illustrated in screen 70E. After processing in the manner above described, the ladder symbol and device identification are inserted at the cursor 73 position after pressing return key 104, as seen in screen 70F.
FIG. 4 shows a detailed view of the ladder diagram create/edit area 71 on display screen 70 of FIG. 3. The display area is separated into a plurality of blocks, defined by the matrix of dotted lines, in which ladder symbols and device numbers are displayed. As seen in FIG. 4, each row of blocks is identified by a line number (1, 2, 3, . . . m) and each column of blocks is identified by a column number (1, 2, 3, . . . n). Each block can contain the identification of a device (X0, X1, X2, X3, . . . Y10), an appropriate ladder symbol, and/or connector lines.
The screen image table, shown in FIG. 5A, is created in the main storage device 22, in correspondence with the line and column positions of the blocks. After the block position control processor 18 has calculated the address in the screen image table in accordance with the line and column positions indicated by the cursor 73 in the ladder diagram create/edit area 71, the ladder data converted into an instruction code and the device data converted into a device code are stored together, in the format of FIG. 5B, in the corresponding screen image table by the screen image table creation processor 17. At the same time, the table creation processor 17 provides the block position controller 18 with a command to progress to the next line or column position. The data in the screen image table is converted into data displayable on the display device 25 by the screen display conversion processor 19 and displayed on the display device 25 in a predetermined format. By repeating the foregoing operation, via a sequence of keying operations and screen displays as previously described in FIG. 3, the data entered from the keyboard 24 is displayed on the display device 25 and the ladder diagram is created.
FIG. 15 is a block diagram illustrating registration and reutilization of a "common" ladder diagram in the conventional unit. Referring to FIG. 15, the numeral (24) indicates an input means such as a keyboard, (2a) a control means for controlling internal operation in accordance with input data, (3a) a ladder program writing means, (4a) a ladder diagram writing means for fetching a common ladder diagram from a ladder program, and (7a) an auxiliary storage device read/write means for transferring data to and from the auxiliary storage device (23).
Operation of the block diagram shown in FIG. 15 will now be described. A PC ladder diagram is written by entering ladder symbols and device numbers of the PC from the keyboard (24) by means of the control program stored in the main storage device (22) and the results are displayed on the display device (25). The written program is sequentially converted inside the main storage device (22) into a program executable by the corresponding PC. After this conversion, the program can be stored in the auxiliary storage device (23) and/or output to the printer (26).
If a like ladder pattern is repeated during writing of the ladder program or if there is a ladder block usable by another PC, a "common" ladder diagram area can be cut from the ladder program as written using the common ladder diagram writing means (4a) and written to the auxiliary storage device (23) via the auxiliary storage device read/write means (7).
When that common ladder diagram area is required later during writing of the ladder program, it can be read from the auxiliary storage device (23) through the auxiliary storage device read/write means (7) and inserted into the ladder program currently being written. Thus a library of commonly used ladder diagram areas or segments may be maintained in storage device (23).
FIG. 16 shows the device and sequence of screens and data displayed during the above conventional operation. In FIG. 16, the area of the common ladder diagram enclosed by the dotted line is written to the auxiliary storage device (23) using the writing means (4a) and the auxiliary storage device read/write means (7a). Later, the common ladder diagram is read from the auxiliary storage device (23) through the auxiliary storage device read/write means (7a) and added to the program currently being written.
As previously noted in FIG. 3, the entered ladder symbol and the specified device are displayed in the ladder diagram create/edit area and the cursor moves to the next block. However, the prior art programming unit configured as described above has a disadvantage in that a programmer cannot write a ladder diagram in terms of logical operation expressions because one device must be specified for one symbol, and, also, many keys must be pressed if a complicated ladder diagram is to be written.
Also, the conventional programming process described above has a disadvantage in that device numbers in an already registered common ladder diagram must be corrected in accordance with PC devices in the program now being written if that common ladder diagram is to be reutilized.